package com.bm.specialvehiclefordispatcher.activity;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.View;

import com.bm.specialvehiclefordispatcher.views.LoadingDialog;

public abstract class BaseFragment extends Fragment {

	protected Activity mActivity;
	protected LoadingDialog dialog;
	protected Handler handler = new Handler();

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mActivity = getActivity();
		dialog = new LoadingDialog(mActivity);
	}
	
	@Override
	public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		
		findViews(view);
		init();
		addListeners();
	}

	protected abstract void findViews(View view);

	protected abstract void init();

	protected abstract void addListeners();
}
